//
//  SuitStatus.swift
//  Yidingzhi
//
//  Created by flybywind on 15/11/26.
//  Copyright © 2015年 flybywind. All rights reserved.
//

import UIKit

class SuitStatus : NSObject{
    var dressType:String
    var mode:String
    var selectPart:String?
    var selectFabric: UIImage?
    var fabricScale: Float
    
    override init() {
        dressType = "西服"
        mode = "style"
        fabricScale = 6
        super.init()
    }
}

struct DressComposite {
    var dress_parts : [String]
    var parts_index = [String:Int]()
    init(parts_list: [String]) {
        for (i,p) in parts_list.enumerate() {
            parts_index[p]=i
        }
        dress_parts = [String](count: parts_list.count, repeatedValue: "")
    }

    mutating func setParts(name:String, value:String) {
        if let i = parts_index[name] {
            dress_parts[i] = value
        }
    }
    mutating func setAllParts(parts_value:[String]) -> Bool{
        if parts_value.count >= dress_parts.count {
            for (i, _) in dress_parts.enumerate() {
                dress_parts[i] = parts_value[i]
            }
        }else {
            return false
        }
        return true
    }
    func getFullName() ->String {
        var ret = ""
        dress_parts.forEach {
            ret = "\(ret)\($0)_"
        }
        return ret
    }
}
struct FabricInfo {
    var Fid: String
    var FabricBrand: String
    var FabricMaterial:String
    var FabricPrice: Float
    var FabricImage: String
    var FabricScale: Float
}